
#ifndef VECTOR2D_H
#define VECTOR2D_H

// INCLUDES ********************************************************************

#include <math.h>

#include <CoreGraphics/CGGeometry.h>

// FORWARD DECLARATIONS ********************************************************

// *****************************************************************************

//! Vector2D
//! 
//! Represents a two dimensional vector

// *****************************************************************************

namespace Meteor 
{
    class Vector2D
    {
        public:
            // Constructors for predefined values
            Vector2D( const float& x= 0, const float& y = 0);
            
            Vector2D( const CGPoint& point);
            
            Vector2D( const Vector2D& point);
        
            Vector2D& operator=( const Vector2D& rhs);
            
            // dot product
            const float operator*( const Vector2D& rhs) const;
        
            const Vector2D operator*( const float& scalar) const;
            
            const Vector2D operator+( const Vector2D& rhs) const;
            
            const Vector2D operator-( const Vector2D& rhs) const;
            
            const Vector2D operator+=( const Vector2D& rhs);
                
            const Vector2D operator-=( const Vector2D& rhs);
            
            const bool operator==( const Vector2D& rhs) const;
            
            const bool operator!=( const Vector2D& rhs) const;
            
            const float Length() const;
            
            const Vector2D& Normalize();
            
            const float X() const;
            
            const float Y() const;
            
            void SetX( const float newX);
            
            void SetY( const float newY);
            
            static const float Angle( Vector2D& lhs, Vector2D& rhs);
            
            static const float Distance( const Vector2D& lhs,
                                         const Vector2D& rhs);
    
        private:
            float mX;
         
            float mY;

    }; // end of struct Vector2D

} // end of namespace Vector

#endif

